package com.lw.yygh.hosp.controller;

import com.lw.yygh.hosp.service.DepartmentService;
import com.lw.yygh.result.Result;
import com.lw.yygh.vo.hosp.DepartmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;
    //根据医院编号，查询医院所有科室列表
    @GetMapping("/findDeptTree/{hoscode}")
    public Result findDeptTree(@PathVariable String hoscode){
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return Result.ok( list );
    }
}
